package cmd

import (
	"fmt"
	"os"

	"github.com/spf13/cobra"
)

const (
	API_URL        = "http://svr01:8080"
	CLIENT_ID      = "pingduoduo"
	CLIENT_SECRET  = "123"
	WORKING_KEY_ID = "asd2"
	KEK_INDEX      = 1
	IPX_INDEX      = 1
	SIGN_PKEY      = "AFZySM0LK1b1Ic4SWQq7GDWmWWnhpnPOx5q6CKqNsmYN"
	SIGN_SKEY      = "NFvAS8PAWhn4CRjmUTL+NywfTZha595XogvNqjzBfIiXGgDO146QqFwlXCbXaA19Eue4WeZGA9FeD5pV"
	ENC_PKEY       = "AGFBgm9W4FJjQo6D/Qxduk7NoG5flz1wYnqSh2cjOt64"
	ENC_SKEY       = "F8vMmANsjKL8x8TG+Do8hWbidoJdeUQsuWmhLVso5WdxHGwt+q8mIjrOsxizqQw6NEm3PGnU1BtB6Lzk"
)

var DEVICE_URLS = [...]string{"http://sec-device-security-8100:8100", "http://sec-device-security-8101:8101"}

var rootCmd = &cobra.Command{
	Use:   "mytool",
	Short: "mytool is a tool to record names", // 子命令的简单说明，务必简短，因为会出现在其上级命令的help结果中，过长会导致换行、不美观，此外还会出现在自动补全时，过长容易影响视线
	Long: `The best tool to record names in the world! // 子命令的功用详细说明，可以写的比较详细些
Just try it!!!
Complete documentation is available at http://mytool.com`,
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("Use mytool -h or --help for help.")
	},
}

func initAll() {
	initVersion()
	initFeature()
	initBench()
}

func Execute() {
	initAll()
	if err := rootCmd.Execute(); err != nil {
		fmt.Println(err)
		os.Exit(1)
	}
}
